<% 
    has_photo = @user.photo
    photo_url = has_photo ? url_for_file_column(@user, "photo") : "no_user_photo" 
%>
<div class="request_info_btn" >
  Status: <%=@user.user_type.to_s %> 
   &nbsp;<%= link_to_remote 'edit', {:update => "request_info",
        :after => "insertWaitingImg('request_info');",
            :url => {:action => "get_request_form"}},{:class => 'add_link'}  %>    
</div>

<h1 class="library_title">User Profile</h1>
<div class="horizontal_line" ></div>
<div id="request_info" ></div>
<%= form_tag({:action => "update_profile"}, {:multipart => true}) %>
    <div class="profile" >
        <table class="profile_data">
            <tr>
                <th>First Name:&nbsp;</th>
                <td><%= text_field("user", "first_name") %></td>
                <td rowspan="11" id="user_photo_container">
                    <%= render :partial => 'user_photo' %>
                </td>
            </tr>
            <tr><th>Last Name:&nbsp;</th><td><%= text_field("user", "last_name") %></td></tr>
            <tr><th>Email:&nbsp;</th><td><%= text_field("user", "email") %></td></tr>
            <tr><th>&nbsp;</th><td>&nbsp;</td></tr>
            <tr><th>New Password:&nbsp;</th><td><%= password_field("user", "password") %></td></tr>
            <tr><th>Retype password:&nbsp;</th><td><%= password_field("user", "password_confirmation") %></td></tr>
            <tr><th>&nbsp;</th><td>&nbsp;</td></tr>
            <tr><th>Phone:&nbsp;</th><td><%= text_field("user", "phone") %></td></tr>
            <tr><th>IM:&nbsp;</th><td><%= text_field("user", "im") %></td></tr>
            <tr><th>&nbsp;</th><td>&nbsp;</td></tr>
            <tr><th>Description:&nbsp;</th><td colspan="2" ><%= text_area "user", "description", :cols => 40, :rows => 6 %></td></tr>
            <tr>
                <th>Photo:&nbsp;</th>
                <td colspan="2" ><%= file_column_field("user", "photo") %></td>
            </tr>
        </table>
        <%= flash_info_tag %>
        <%= error_messages_for(:user) %>
    </div>
    <div class="horizontal_line"></div>
    <div id="submit_profile" ><%= submit_tag "Save Changes" %></div>
<%= end_form_tag %>